<template>
  <div
    class="rolemanage-detail-base"
    style="position: absolute; top: 0; left: 0; display: flex; width: 100%; height: calc(100% + 0px)"
  >
    <div style="width: 196px; height: 100%; color: white; background-color: #222834">
      <a-page-header title="返回角色管理" @back="cancal" />
    </div>

    <div style="width: calc(100% - 196px)">
      <div class="perm-detail">
        <div class="content">
          <div style="font-size: 14px"></div>
          <div class="content-body">
            <div class="title">{{ currentItem.name }}</div>
            <a-tabs v-model:activeKey="activeKey">
              <a-tab-pane key="1" tab="基本信息">
                <detailaInfo @update-success="updateSuccess"></detailaInfo>
              </a-tab-pane>
              <a-tab-pane key="2" tab="关联人员">
                <detailbRole></detailbRole>
              </a-tab-pane>
              <a-tab-pane key="3" tab="关联权限">
                <detailcPermi></detailcPermi>
              </a-tab-pane>
            </a-tabs>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
import { ref, reactive, inject, defineEmits, onMounted } from 'vue'
import { ArrowLeftOutlined } from '@ant-design/icons-vue'
import detailaInfo from './detailaInfo'
import detailbRole from './detailbRole'
import detailcPermi from './detailcPermi'
const { currentItemId: currentItem, upperRol, editActiveKey } = inject('roleParams')
const activeKey = ref('1')
activeKey.value = editActiveKey.value
const emit = defineEmits(['closeEdit', 'updateSuccess'])
let menu = document.getElementById('indexlayout-left')
let menutop = document.getElementById('indexlayout-right-top')
onMounted(() => {
  menu.style.display = 'none'
  menutop.style.display = 'none'
})
const cancal = () => {
  menu.style.display = 'initial'
  menutop.style.display = 'initial'
  emit('closeEdit', false)
}
const updateSuccess = (modelRef) => {
  emit('updateSuccess', modelRef)
}
</script>

<style lang="less" scoped>
.perm-detail {
  display: flex;
  width: 100%;
  //position: absolute;
  //top: 0px;
  //left: 0px;
  height: calc(100% - 0px);
  padding: 15px;
  background-color: white;

  .content {
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    padding: 5px 15px;
    background-color: white;

    .content-body {
      height: calc(100% - 17px);

      .title {
        font-weight: bolder;
        font-size: 28px;
      }
    }
  }
}

:deep .ant-page-header-back-button {
  color: #fff;
}

:deep .ant-page-header-heading-title {
  color: #fff;
  font-size: 16px;
}
</style>
<style lang="less">
.rolemanage-detail-base {
  .perm-detail {
    .ant-tabs {
      height: auto !important;

      .ant-tabs-content {
        height: auto !important;
      }
    }
  }
}
</style>
